package com.expressage.service.impl;

import com.expressage.dao.CompleteDao;
import com.expressage.po.Complete;
import com.expressage.service.CompleteService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.sql.Timestamp;
import java.util.List;

/**
 * @author Gt
 * 评价业务逻辑实现类
 */
@Service("/completeService")
public class CompleteServiceImpl implements CompleteService {

    @Autowired
    CompleteDao completeDao;

    @Override
    public List<Complete> findAll() {
        return completeDao.findAll();
    }

    @Override
    public Complete findBypid(int pid) {
        return completeDao.findBypid(pid);
    }

    @Override
    public boolean insert(Complete complete) {
        complete.setDate(new Timestamp(System.currentTimeMillis()));//当前的时间
        return completeDao.insert(complete)>0?true:false;
    }

    @Override
    public boolean delete(int[] arrays) {
        return completeDao.delete(arrays)>0?true:false;
    }

    @Override
    public boolean update(Complete complete) {
        return completeDao.update(complete)>0?true:false;
    }
}
